home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 23 / 023.d81 / pachyderm panic (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  5KB  |  152 lines

  1. 10 gosub60000
  2. 15 poke53280,12:poke53281,15
  3. 20 print"[147][144]checking data";:forj=1to131:reada:x=x+a:nextj
  4. 30 ifx<>14735thenprint"  error":stop
  5. 35 print"  ok":restore
  6. 40 b$="":c$="":d$=""
  7. 50 e$="                                        "
  8. 60 f$="":v=54272:pokev+24,15:p=53248:x=0
  9. 70 poke198,0:gosub500:ifnp=2thengosub820:gosub350
  10. 80 gosub840:gosub350:gosub390:r=1
  11. 90 l=l+1:t=l:h=l*2:p1=t:p2=t:y=l*25:d=1
  12. 100 rem *** computer chooses ***
  13. 110 forj=1tot
  14. 120 n=int(rnd(1)*8)+1:a(j)=n
  15. 130 poke251,j:poke252,n:sys49152:ifpeek(252)<>nthen120
  16. 140 poke49999+j,n:pokep+38+n,1:s=a(j):gosub1000
  17. 150 gosub395:nextj:gosub700
  18. 200 rem *** player input ***
  19. 205 ts=ti:tf=t*2:forj=1tot:poke198,0
  20. 210 geta$:if(ti-ts)/60>=tfthenj=t:nextj:gosub1200:goto340
  21. 220 ifa$=""then210
  22. 225 if a$="_" then 965
  23. 230 s=val(a$):ifs<1ors>8thenifj>1thenpokep+38+b(j-1),e:j=j-1:goto210
  24. 240 ifs<1ors>8then210
  25. 250 pokep+38+s,c:poke198,0:gosub1000:ifj=tthenfori=1to75
  26. 260 ifpeek(198)=1andj=tthenifpeek(631)<49orpeek(631)>56then290
  27. 270 ifj=tthennexti
  28. 280 b(j)=s:nextj:gosub700:goto300
  29. 290 i=100:nexti:pokep+38+s,e:poke198,0:goto210
  30. 300 rem *** compare input and calculate the score ***
  31. 305 x=0:forj=1tot:ifb(j)<>a(j)thenx=x+1
  32. 310 nextj:ifx=0thensc=sc+t*2:gosub1100:goto350
  33. 315 printc$b$"[146]elephant said:"c$tab(17);:forj=1tot:s=a(j)
  34. 320 pokep+38+s,1:prints;:gosub1000:gosub395:nextj:gosub700:gosub395
  35. 325 printd$b$k$p$" said:"d$tab(17);:forj=1tot:s=b(j)
  36. 330 pokep+38+s,c:prints;:gosub1000:gosub395:nextj:gosub395
  37. 335 sc=sc+t-x
  38. 340 ift>lthent=t-1
  39. 350 printsc$sc:ifr=0thenreturn
  40. 355 gosub700:gosub395:ifnp=1thenvs=sc:goto370
  41. 360 ifd=1thenvs=sc:goto375
  42. 365 hs=sc
  43. 370 ifvs>=yorhs>=ythenifvs<>hsthen900
  44. 375 ifnp=2thend=-d:gosub800
  45. 380 printc$e$d$e$:sys49174:gosub390:goto100
  46. 390 fori=1to500:nexti:return
  47. 395 fori=1to200:nexti:return
  48. 500 rem *** number of players, level, and names ***
  49. 510 np=1:printf$"number of players (1-2)";:inputnp
  50. 515 ifval(chr$(np+48))<1orval(chr$(np+48))>2then510
  51. 520 l=1:printf$"level: 1=easy  2=medium  3=hard";:inputl
  52. 525 ifval(chr$(l+48))<1orval(chr$(l+48))>3then520
  53. 530 p1$="player 1":printf$"name of player 1 ";:inputp1$
  54. 540 p1$=left$(p1$,8)
  55. 550 ifnp=1then580
  56. 560 p2$="player 2":printf$"name of player 2 ";:inputp2$
  57. 570 p2$=left$(p2$,8)
  58. 580 print"[147]setting up"
  59. 590 print"'_' returns to loadstar"
  60. 595 fort=1to1800:next
  61. 600 rem *** sprites ***
  62. 610 forj=2040to2047:pokej,13:nextj
  63. 620 forj=1to30:reada:nextj
  64. 630 forj=832to832+62:reada:pokej,a:nextj
  65. 640 pokep,48:pokep+1,100:pokep+2,112:pokep+3,100
  66. 650 pokep+4,184:pokep+5,100:pokep+6,248:pokep+7,100
  67. 660 pokep+8,48:pokep+9,148:pokep+10,112:pokep+11,148
  68. 670 pokep+12,184:pokep+13,148:pokep+14,248:pokep+15,148
  69. 680 pokep+28,255:pokep+37,7:pokep+38,12
  70. 690 pokep+29,255:pokep+23,255
  71. 700 e=0
  72. 710 forj=p+39top+46:pokej,e:nextj:ifr=1thenreturn
  73. 720 print"[147]":pokep+21,255
  74. 730 rem *** print numbers in the sprites ***
  75. 740 print"[144]1234"
  76. 750 print"5678[146]"
  77. 760 rem *** load ml (keep computer from duplicating input) ***
  78. 770 forj=49152to49189:reada:pokej,a
  79. 780 nextj:restore:return
  80. 800 rem *** change sides ***
  81. 810 ifd=1then840
  82. 815 print"                           ^          "
  83. 820 p$=p2$:sc=hs:p2=t:t=p1:c=6:k$=""
  84. 830 sc$=""+p2$+"  ":return
  85. 840 p$=p1$:sc=vs:p1=t:t=p2:c=2:k$=""
  86. 845 print"         ^                            "
  87. 850 sc$=""+p1$+"  ":return
  88. 900 rem *** victory ***
  89. 910 printc$e$d$e$
  90. 920 ifvs>hsornp=1thenc=2:goto940
  91. 930 c=6
  92. 940 forx=1to3:e=c:gosub1300:nextx
  93. 950 printd$tab(12)"[146][144]press any key"
  94. 955 printd$tab(12)"[146][144]'_' returns to loadstar"
  95. 960 geta$:ifa$=""then960
  96. 965 if a$="_" then poke928,0:poke53248+21,0:load"hello connect",8
  97. 970 pokep+21,0:run
  98. 1000 rem *** sound of computer and player input ***
  99. 1010 fori=0to23:pokev+i,0:nexti
  100. 1020 pokev+1,s+25:pokev+6,240:pokev+4,21
  101. 1030 fori=1to100:nexti:pokev+4,20:return
  102. 1100 rem ***sound and visual effects after correct input ***
  103. 1110 fori=0to23:pokev+i,0:nexti
  104. 1120 pokev+6,240:forn=1to2:fori=1tot:e=1:gosub1170
  105. 1130 nexti:fori=tto1step-1:e=c:gosub1170:nexti
  106. 1140 nextn:fori=1tot:e=1:gosub1170:nexti
  107. 1150 ift<hthent=t+1
  108. 1160 return
  109. 1170 pokev+4,21:pokep+38+b(i),e:pokev+1,i+25
  110. 1180 forn1=1to5:nextn1:pokev+4,20:return
  111. 1200 rem *** buzzer (times up) ***
  112. 1210 fori=vtov+23:pokei,0:nexti
  113. 1220 printc$tab(11)"[144]sorry, times up."
  114. 1230 pokev+1,7:pokev+6,130:pokev+4,33
  115. 1240 gosub395:pokev+4,32:return
  116. 1300 rem *** victory tune ***
  117. 1310 fori=vtov+23:pokei,0:nexti:pokev+5,30:pokev+6,85
  118. 1320 pokev+12,85:pokev+13,85:gosub710
  119. 1330 fori=1to6:reada,a1,a2,a3,a4:pokev+4,33:pokev+11,17
  120. 1340 pokev+1,a:pokev,a1:pokev+8,a2:pokev+7,a3:forn=1toa4
  121. 1350 nextn:pokev+4,32:pokev+11,16:nexti:ifx<3thengosub700
  122. 1360 forn=1to100:nextn:restore:return
  123. 1400 rem *** victory tune data ***
  124. 1410 data25,30,18,209,50,33,135,25,30,50,42
  125. 1420 data62,31,165,50,50,60,37,162,130,42
  126. 1430 data62,31,165,50,50,60,37,162,165
  127. 1500 rem *** sprite data ***
  128. 1510 data5,0,0,10,0,0,85,80,0,63,192,0,59,234,128
  129. 1520 data59,234,188,255,234,191,255,224,179,255,224,176
  130. 1530 data195,224,176,243,224,176,243,234,176,3,234,176
  131. 1540 data3,213,112,3,255,240,3,243,240,2,162,160
  132. 1550 data2,162,160,0,0,0,0,0,0,0,0,0
  133. 1600 rem *** ml data ***
  134. 1610 data160,0,165,252,217,80,195,240,8,200,196
  135. 1620 data251,240,7,76,4,192,169,0,133,252,96
  136. 1630 data160,0,169,0,153,80,195,200,192,8,240,3,76,26,192,96
  137. 60000 nm$="[194]uck [195]hildress":pr$="[208]achyderm"
  138. 60005 deffncn(n)=int(19-n/2)
  139. 60010 t$="                         ":c=0:c$="":print"[147]":poke53281,0
  140. 60015 printspc(7)""t$:printspc(7)"                         [146]"
  141. 60020 printtab(fncn(len(pr$)))"[145]"pr$
  142. 60025 printspc(7)""t$:print:printtab(18)"by"
  143. 60030 print:printspc(fncn(len(nm$)))"[158]"nm$""
  144. 60035 print:printspc(12)"[195]opyright 1986"
  145. 60040 print:print:print:print"     [204][207][193][196][211][212][193][210] is not public domain."
  146. 60045 print:print"  [208]lease respect the author's rights."
  147. 60050 print:print"      [208]ress space bar to continue."
  148. 60055 forcc=1to48:getk$:ifk$=" "then60070
  149. 60060 ifcc=1thenprintmid$(c$,c+2,1)"[145][145]";:c=not(c)
  150. 60065 next:goto60050
  151. 60070 printc$chr$(142):return
  152.